package bytecharstream;

import java.io.FileOutputStream;
import java.io.IOException;

public class output {

    public static void main(String[] args) throws IOException {

        // 定义一个字符串对象
        String a = "星星会不会趁着人间烟火坠落时,偷偷溜下来见想见的人。";
        String b = "我想在山谷开一家店，贩卖猫的脚步声。";

        // 创建文件输出流对象
        FileOutputStream out = new FileOutputStream("src/File/out.txt");
        FileOutputStream output = new FileOutputStream("src/File/out.txt",true);

        // 将字符串转化为字节数组进行写入操作
        out.write(a.getBytes());
        output.write(b.getBytes());

        // 关闭流
        out.close();
    }

}
